1. Field of the Invention
The present invention relates to an image processing technique to compress and decompress a multivalued image.
2. Description of the Related Art
In recent years, with the spread of scanners, electronization of documents is in progress. In the case where electronized document data is saved in a full-color bitmap format, for example, for an A4-size document, the data size will be about 24 Mbytes with a read resolution of 300 dpi. This means that the capacity of a necessary memory will become very large and the size of the data is too large to transmit as an attachment to an email, and therefore, it is requested to reduce the data capacity as much as possible.
Consequently, in order to reduce the data capacity, usually, a read image (full-color image) is compressed and as a compression method, JPEG is known. JPEG is very effective for compression of a natural image such as a photo, but it is known that a deterioration in an image, called mosquito noise, occurs in the case where a character portion is compressed by JPEG. In order to solve this problem, a method has been proposed conventionally, which divides an input full-color image into a character area and a photo area and the character area is binarized and then compressed by MMR and the photo area is compressed by JPEG, and thereby, the data size is reduced while keeping the quality of the character area.
The above-described conventional method is characterized in that the white portion of the binary image is caused to show through the JPEG image and the black portion is represented by characters colored in a representative color determined for each character or for each character area at the time of decompression. Due to this, it is made possible to remove variations caused by scanner reading of the character portion originally represented in a single color. In addition to this, a high quality and highly compressed image is obtained by using a compression system. In order for this method to implement high image quality, extracting an appropriate representative color from the characters of the character area portion will be important. As to this point, there has been such a problem that the color of the background may permeate into the character due to the variations caused by scanner reading or the action of compression, and the color of the character area in the input image in which such permeation has occurred is reproduced (extracted) as it is at the time of color extraction.
For such a problem in the color extraction technique, it has been proposed to allocate a predetermined color (e.g., white) to a reversed character whose color distance between the average color of the unit character and the representative color is within a predetermined range at the time of allocating the representative color of the character to the unit character (Japanese Patent Laid-Open No. 2004-260327).
The technique proposed in Patent Document 1 of Japanese Patent Laid-Open No. 2004-260327 is the technique to set a predetermined color that is more highlighted than the original character color as the representative color of the character in order to improve visual recognizability of the character. Then, for example, also in the case where the character within the input image is a reversed character and the color of the reversed character is a pale color other than white, the predetermined color (e.g., white) is allocated as the character representative color.
In other words, in the case of Japanese Patent Laid-Open No. 2004-260327 described above, to the reversed character area other than white as described above, a color different from the original color of the reversed character is allocated as the character representative color. Further, in the case of an input image in which the reversed character area having a pale character color occupies the majority of the image, there will be produced a large apparent difference between the image in the state before compression (input image) and the image in the state after decompression (restored image).